package com.quanyan.place.enums;

import com.quanyan.common.enums.BaseEnum;

import java.util.HashSet;
import java.util.Set;

/**
 * 场馆支付方式
 */
public enum PayTypeEnum implements BaseEnum {
    PAY_WAY_ALIPAY(1, "1", "支付宝支付", 1, "支付宝" ),
    PAY_WAY_WEIXIN(2, "2", "微信支付", 2, "微信" ),
    PAY_WAY_EGG(7, "7", "鸟蛋", 7, "鸟蛋" ),
    PAY_WAY_MEMBER_CARD(10, "10", "会员卡", 10, "会员卡" ),
    PAY_WAY_COUPON(11, "11", "优惠券", 11, "优惠券" ),
    PAY_WAY_CASH(20, "20", "现金", 20, "现金" ),
    PAY_WAY_WECHAT_SCAN(21, "21", "微信扫码", 2, "微信" ),
    PAY_WAY_ALIPAY_SCAN(22, "22", "支付宝扫码", 1, "支付宝" ),
    PAY_WAY_POS(23, "23", "POS银行卡", 23, "POS银行卡" ),
    PAY_WAY_POS_UNIONPAY(36, "36", "pos银行卡（银联)", 23, "POS银行卡" ),
    PAY_WAY_PLACE_BOSS(24, "24", "与场馆老板结算（会员）", 24, "与场馆老板结算" ),
    PAY_WAY_PLACE_BOSS_NOT_MEMBER(35, "35", "与场馆老板结算（散客）", 24, "与场馆老板结算" ),
    PAY_WAY_EXTERNAL_COMP(25, "25", "与外部公司结算", 25, "与外部公司结算" ),
    PAY_WAY_COMPANY_INNER(26, "26", "与公司内部核算", 26, "与公司内部核算" ),
    PAY_WAY_PUBLIC_TRANSFER(29, "29", "对公转账", 29, "对公转账" ),
    PAY_WAY_BILL_THIRD(30, "30", "挂账", 30, "挂账" ),
    PAY_WAY_GROUP_TICKET_THIRD(31, "31", "团购券", 31, "团购券" ),
    PAY_WAY_ALIPAY_THIRD(32, "32", "支付宝(场馆自有)", 32, "支付宝(场馆自有)" ),
    PAY_WAY_WEIXIN_THIRD(33, "33", "微信(场馆自有)", 33, "微信(场馆自有)" ),
    PAY_WAY_POS_THIRD(34, "34", "POS银行卡(场馆自有)", 34, "POS银行卡(场馆自有)" ),
    PAY_WAY_GIVE(37,"37","赠送",37,"赠送"),
    ;
    protected int id;

    protected String code;

    protected String label;

    private int unifiedId; // 统一id

   

	private String unifiedName; // 统一名称

    private String desc; // 描述


    /**
     * 支付方式
     * @param id   存储原子方式
     * @param code       代码
     * @param label      显示名称
     * @param unifiedId  公司统一id
     * @param unifiedName 公司统一显示名称
     */
    PayTypeEnum(int id, String code, String label, int unifiedId, String unifiedName) {
        this.id = id;
        this.code = code;
        this.label = label;
        this.unifiedId = unifiedId;
        this.unifiedName = unifiedName;
    }


    @Override
    public int getId() {
        return id;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getLabel() {
        return label;
    }

    public int getUnifiedId() {
        return unifiedId;
    }

    @Override
    public boolean isSuccess() {
        return true;
    }

    /**
     * 描述：返回指定id的Enum
     * @param id
     * @return
     */
    public static PayTypeEnum getEnum(int id){
        for (PayTypeEnum tmpEnum : PayTypeEnum.values()) {
            if(tmpEnum.getId() == id)
                return tmpEnum;
        }
        return null;
    }

    /**
     * 获取支付方式
     * @return
     */
    public static Set<Integer> getPayTypeEnumSet(){
        Set<Integer> payTypeSet = new HashSet<Integer>();
        for (PayTypeEnum tmpEnum : PayTypeEnum.values()) {
            payTypeSet.add(tmpEnum.getId());
        }
        return payTypeSet;
    }

    /**
     *  获取统一的支付方式
     * @return
     */
    public static Set<Integer> getUnifiedPayTypeEnumSet(){
        Set<Integer> payTypeSet = new HashSet<Integer>();
        for (PayTypeEnum tmpEnum : PayTypeEnum.values()) {
            payTypeSet.add(tmpEnum.getUnifiedId());
        }
        return payTypeSet;
    }

    
    /**
   	 * @return the unifiedName
   	 */
   	public String getUnifiedName() {
   		return unifiedName;
   	}


   	/**
   	 * @param unifiedName the unifiedName to set
   	 */
   	public void setUnifiedName(String unifiedName) {
   		this.unifiedName = unifiedName;
   	}


   	/**
   	 * @return the desc
   	 */
   	public String getDesc() {
   		return desc;
   	}


   	/**
   	 * @param desc the desc to set
   	 */
   	public void setDesc(String desc) {
   		this.desc = desc;
   	}
}
